oxenstored: use hash table to store socket connections
authorZheng Li <dev@zheng.li>
Thu, 25 Sep 2014 17:34:58 +0000 (18:34 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 8 Oct 2014 13:18:46 +0000 (14:18 +0100)
commita3967c5e42f7c50ea4ece2350020ef7b5ece49ba
tree5e4b684ae105605344359eca8ae8079a77c03500
parent57ba43cdf804998fc7dd70025d870effb4b4686c
oxenstored: use hash table to store socket connections

Currently we use list to store socket connections. This is fine for smaller
number of connections. But when we scale up, traveling through a list of
hundreds or thousands of connections just to find a single one of them is very
low efficient.

This patch replaces the list with a (Unix.file_descr -> Connection.t) hash table.

Signed-off-by: Zheng Li <dev@zheng.li>
Reviewed-by: David Scott <dave.scott@citrix.com>
tools/ocaml/xenstored/connections.ml